package com.ck.common;

import com.ck.core.constant.UserType;

import java.io.Serializable;

/**
* @Description: 用户会话信息（仅保存关键信息，业务需要的其他用户信息需要自行查询获得）
 *             //  see com.ck.ips.model.User
* @Author: hf
* @Date:    2019/4/29 9:51
* @Version: 1.0
*/
public class SessionUser implements Serializable{

	private static final long serialVersionUID = -3334002824620007282L;
	/**
	 * 用户主键
	 */
	private Long userId;
	/**
	 * 用户名
	 */
	private String userName;
	/**
	 * 用户真实姓名
	 */
	private String realName;
	/**
	 * token
	 */
	private String token;
	/**
	 * 用户类型
	 */
	private String userType;

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public boolean isSuper(){
		return UserType.SUPER.name().equalsIgnoreCase(userType);
	}

	public SessionUser() {
	}

	public SessionUser(Long userId, String userName) {
		this.userId = userId;
		this.userName = userName;
	}

	public SessionUser(Long userId, String userName, String realName, String token, String userType) {
		this.userId = userId;
		this.userName = userName;
		this.realName = realName;
		this.token = token;
		this.userType = userType;
	}
}